ComponentOne Data Source for Entity Framework
C1.LiveLinq Namespace / IndexedQueryExtensions Class / GroupBy Method / GroupBy<TSource,TKey,TElement>(IIndexedSource<TSource>,Expression<Func<TSource,TKey>>,Expression<Func<TSource,TElement>>) Method
The type of the elements of source.
The type of the key returned by keySelector.
The type of the elements in the System.Linq.IGrouping`2.
An C1.LiveLinq.Indexing.IIndexedSource<T> whose elements to group
A function to extract the key for each element.
A function to map each source element to an element in the System.Linq.IGrouping`2.

In This Topic
    GroupBy<TSource,TKey,TElement>(IIndexedSource<TSource>,Expression<Func<TSource,TKey>>,Expression<Func<TSource,TElement>>) Method
    In This Topic
    Groups the elements of a collection according to a specified key selector function and projects the elements for each group by using a specified function.
    Syntax
    'Declaration
     
    
    Public Overloads Shared Function GroupBy
        (Of TSource,TKey,TElement)( _
       ByVal source As IIndexedSource(Of TSource), _
       ByVal keySelector As System.Linq.Expressions.Expression(Of Func(Of TSource,TKey)), _
       ByVal elementSelector As System.Linq.Expressions.Expression(Of Func(Of TSource,TElement)) _
    ) As IIndexedSource(Of IGrouping(Of TKey,TElement))
    public static IIndexedSource<IGrouping<TKey,TElement>> GroupBy<TSource,TKey,TElement>( 
       IIndexedSource<TSource> source,
       System.Linq.Expressions.Expression<Func<TSource,TKey>> keySelector,
       System.Linq.Expressions.Expression<Func<TSource,TElement>> elementSelector
    )

    Parameters

    source
    An C1.LiveLinq.Indexing.IIndexedSource<T> whose elements to group
    keySelector
    A function to extract the key for each element.
    elementSelector
    A function to map each source element to an element in the System.Linq.IGrouping`2.

    Type Parameters

    TSource
    The type of the elements of source.
    TKey
    The type of the key returned by keySelector.
    TElement
    The type of the elements in the System.Linq.IGrouping`2.

    Return Value

    A collection of System.Linq.IGrouping`2 objects each containing a collection of objects of type TElement and a key.
    See Also